import os

from backend_django.settings import BASE_DIR, INSTALLED_APPS


def get_frontend_base_dir():
    return os.path.join(BASE_DIR.parent, 'frontend_vue3')


def get_frontend_app():
    app_dir = os.path.join(BASE_DIR.parent, 'frontend_vue3', 'src', 'views', 'main')
    app_list = []
    for folder_name in os.listdir(app_dir):
        if os.path.isdir(os.path.join(app_dir, folder_name)):
            app_list.append(folder_name)
    print(app_list)
    return app_list


def get_backend_app():
    return INSTALLED_APPS


if __name__ == '__main__':
    print(BASE_DIR)
    print(BASE_DIR.parent)
    front_end_base_dir = os.path.join(BASE_DIR.parent, 'frontend_vue3')
    print(front_end_base_dir)
    get_frontend_app()
